package com.budwk.app.sqfwV2.enums.weiqingmen;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * 特殊老年人探访
 */
@Getter
public enum SafetyCheckEnum {
    // excel start ----
    NINE_SMALL_DAILY_INSPECTION("1", "九小场所日常排查",
            "九小场所日常排查", "【九小场所日常排查】台账",
            "九小场所日常排查模板", "excel", "/preview/safety/weiqingmen/template-xlsx-1.jpg", 1),
    FIRE_SAFETY_INSPECTION("2", "今冬明春火灾防控“三清单”",
            "今冬明春火灾防控“三清单“", "【今冬明春火灾防控“三清单“】台账",
            "今冬明春火灾防控“三清单模板”", "excel", "/preview/safety/weiqingmen/template-xlsx-9.jpg", 2),
    GAS_SAFETY_INSPECTION("3", "燃气安全排查情况统计周报表",
            "燃气安全排查情况统计周报表", "附件1【燃气安全排查情况统计周报表】统计",
            "燃气安全排查情况统计周报表模板", "excel", "/preview/safety/weiqingmen/template-xlsx-7.jpg", 8),
    GAS_USAGE_AND_STORAGE("4", "夜市摊点、游摊游贩燃气表",
            "夜市摊点、游摊游贩燃气表", "附件3【夜市摊点、游摊游贩燃气】台账",
            "夜市摊点、游摊游贩燃气表模板", "excel", "/preview/safety/weiqingmen/template-xlsx-5.jpg", 6),
    GAS_CATERING_USERS("5", "城镇燃气餐饮用户表",
            "城镇燃气餐饮用户表", "附件4【城镇燃气餐饮用户】台账",
            "城镇燃气餐饮用户表模板", "excel", "/preview/safety/weiqingmen/template-xlsx-6.jpg", 7),
    KEY_UNIT_OF_FIRE_SAFETY("6", "消防安全重点单位",
            "消防安全重点单位", "【消防安全重点单位】台账",
            "消防安全重点单位模板", "excel", "/preview/safety/weiqingmen/template-xlsx-4.jpg", 5),
    FIRE_SAFETY_IMG("12", "今冬明春隐患整改照片",
            "今冬明春隐患整改照片", "【今冬明春隐患整改照片】台账",
            "今冬明春隐患整改照片模板", "excel", "/preview/safety/weiqingmen/template-xlsx-3.jpg", 4),
//    IMPROVEMENT_PROGRESS_STATISTICS("13", "灾防控排查整治进度统计",
//            "灾防控排查整治进度统计", "【灾防控排查整治进度统计】台账",
//            "灾防控排查整治进度统计模板", "excel", "/preview/safety/weiqingmen/template-xlsx-8.jpg", 9),
    THREE_LISTS_OF_SPECIAL_PROJECT("14", "专项排查“三清单”记录",
            "专项排查“三清单”记录", "【专项排查“三清单”记录】台账",
            "专项排查“三清单”记录模板", "excel", "/preview/safety/weiqingmen/template-xlsx-2.jpg", 3),
    SMS("400", "短信发送记录",
            "短信发送记录", "【短信发送记录】台账",
            "短信发送记录", "excel", "/preview/safety/weiqingmen/template-xlsx-8.jpg", 10),

    // excel end ----

    // pdf start ----
    TRAFFIC_EMERGENCY_INSPECTION("20", "交通应急巡查台账",
            "交通应急巡查台账", "【交通应急巡查台账】合集",
            "交通应急巡查台账模板", "pdf", "/preview/safety/weiqingmen/template-pdf-2.jpg", 12),
    THREE_IN_ONE_INSPECTION("21", "三合一应急巡查台账",
            "三合一应急巡查台账", "【三合一应急巡查台账】合集",
            "三合一应急巡查台账模板", "pdf", "/preview/safety/weiqingmen/template-pdf-3.jpg", 13),
    EMERGENCY_INSPECTION("22", "应急巡查台账",
            "应急巡查台账", "【应急巡查台账】合集",
            "应急巡查台账模板", "pdf", "/preview/safety/weiqingmen/template-pdf-1.jpg", 11),
    SAFETY_INVESTIGATE_RENOVATE("23", "安全排查整治表",
            "安全排查整治表", "【安全排查整治表】合集",
            "安全排查整治表模板", "pdf", "/preview/safety/weiqingmen/template-pdf-1.jpg", 17),
    FIRE_SAFETY_IN_CATERING_ESTABLISHMENTS("24", "餐饮经营服务场所消防安全巡查台账",
            "餐饮经营服务场所消防安全巡查台账", "【餐饮经营服务场所消防安全巡查台账】合集",
            "餐饮经营服务场所消防安全巡查台账模板", "pdf", "/preview/safety/weiqingmen/template-pdf-4.jpg", 14),
    BOTTLED_GAS_USER_SAFETY_MANAGEMENT("25", "瓶装燃气用户安全管理巡查台账",
            "瓶装燃气用户安全管理巡查台账", "【瓶装燃气用户安全管理巡查台账】合集",
            "瓶装燃气用户安全管理巡查台账模板", "pdf", "/preview/safety/weiqingmen/template-pdf-5-1.jpg," +
            "/preview/safety/weiqingmen/template-pdf-5-2.jpg,/preview/safety/weiqingmen/template-pdf-5-3.jpg", 15),
    KEY_PLACE("26", "重点场所隐患巡查台账",
            "重点场所隐患巡查台账", "【重点场所隐患巡查台账】合集",
            "重点场所隐患巡查台账模板", "pdf", "/preview/safety/weiqingmen/template-pdf-6.jpg", 16),

    // pdf end ----
    ;

    private String code;
    private String name;
    private String oneName;
    private String compilationName;
    private String templateName;
    private String fileType;
    private String img;
    private int order;

    SafetyCheckEnum(String code, String name, String oneName, String compilationName, String templateName, String fileType, String img, int order) {
        this.name = name;
        this.code = code;
        this.oneName = oneName;
        this.compilationName = compilationName;
        this.templateName = templateName;
        this.fileType = fileType;
        this.img = img;
        this.order = order;
    }

    public static String getName(String code) {
        for (SafetyCheckEnum o : SafetyCheckEnum.values()) {
            if (o.getCode().equals(code)) {
                return o.getName();
            }
        }
        return null;
    }

    public static String getOneName(String code) {
        for (SafetyCheckEnum o : SafetyCheckEnum.values()) {
            if (o.getCode().equals(code)) {
                return o.getOneName();
            }
        }
        return null;
    }

    public static String getCompilationName(String code) {
        for (SafetyCheckEnum o : SafetyCheckEnum.values()) {
            if (o.getCode().equals(code)) {
                return o.getCompilationName();
            }
        }
        return null;
    }

    public static String getTemplateName(String code) {
        for (SafetyCheckEnum o : SafetyCheckEnum.values()) {
            if (o.getCode().equals(code)) {
                return o.getTemplateName();
            }
        }
        return null;
    }

    public static SafetyCheckEnum getEnum(String code) {
        for (SafetyCheckEnum o : SafetyCheckEnum.values()) {
            if (o.getCode().equals(code)) {
                return o;
            }
        }
        return null;
    }

    public static List<SafetyCheckEnum> getPdf() {
        List<SafetyCheckEnum> list = new ArrayList<>();
        for (SafetyCheckEnum o : SafetyCheckEnum.values()) {
            if (o.getFileType().equals("pdf")) {
                list.add(o);
            }
        }
        return list;
    }

    public static List<SafetyCheckEnum> getExcel() {
        List<SafetyCheckEnum> list = new ArrayList<>();
        for (SafetyCheckEnum o : SafetyCheckEnum.values()) {
            if (o.getFileType().equals("excel")) {
                list.add(o);
            }
        }
        return list;
    }
}
